Skip to content

remove warning from nbdev as pkg_resources is already deprecated #1522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kurianbenoy-sarvam
Copy link

@kurianbenoy-sarvam kurianbenoy-sarvam commented Jun 14, 2025

@jph00 I have constantly getting this warning in my nbdev projects for the last few months. Today is the day to fix it.

The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources,importlib

(sarvamai-dubbing) ➜  sarvamai-dubbing git:(main) ✗ nbdev_prepare
/Users/kurianbenoy/git/dubbing-repos/sarvamai-dubbing/.venv/lib/python3.12/site-packages/nbdev/doclinks.py:20: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  import pkg_resources,importlib
  • Many thanks to you and @hamelsmu for building nbdev. I now maintain packages with 1M+ downloads all thanks to you. I hope you remeber me, as I was the kid, who got kicked off from fast.ai class :)

@kurianbenoy-sarvam kurianbenoy-sarvam changed the title remove deprecate pkg_resource from nbdev remove deprecated pkg_resources from nbdev Jun 14, 2025
@kurianbenoy-sarvam kurianbenoy-sarvam changed the title remove deprecated pkg_resources from nbdev remove warning from nbdev as pkg_resources is already deprecated Jun 14, 2025
if incl_libs is not None and o.dist.key not in incl_libs: continue
try: entries[o.name] = _qual_syms(o.resolve())
eps = importlib.metadata.entry_points()
for o in eps.select(group='nbdev') if hasattr(eps, 'select') else eps.get('nbdev', []):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't appear to be valid python syntax. Be sure to carefully test all code you add before you put a PR in! I'll take a look at fixing this issue on my end.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be valid python code.

Also all the tests where passing when I tried out.

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can see the error in the notebook.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Are you expecting me to run this in notebook?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I ran this notebook end to end and still did not face any issues.

image

@kurianbenoy-sarvam
Copy link
Author

image

  • Sharing screenshot of nbdev_prepare, without any warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants